<%layout("../common/_layout.html", {nav: "发布文章管理"}) {%>
<div class="result-title">
  <div class="result-list">
    <a href="/admin/article/add">添加文章</a>
  </div>
  <form action="/admin/article/index" method="post">
  <table class="search-tab">
    <tr>
      <th>文章类别</th>
      <td>
        <select name="cid" id="cid">
          <%for(option in @catalogCache.getOptionListAll()) {%>
            <%if(has(cid) && cid == option.value) {%>
              <option value="${option.value}" selected>${option.name}</option>
            <%} else {%>
              <option value="${option.value}">${option.name}</option>
            <%}%>
          <%}%>
        </select>
      </td>
      <th>文章标题</th>
      <td><input type="text" class="common-text" size="30" name="title" value="${title!}"></td>
      <td><input type="submit" class="btn btn-primary btn6 mr10" value="查询"></td>
    </tr>
  </table>
  </form>
</div>
<div class="result-content">
  <table class="result-tab" width="100%">
    <tr>
      <th width="5%">No.</th>
      <th>文章标题</th>
      <th>文章类别</th>
      <th>发布时间</th>
      <th>作者</th>
      <th>操作</th>
    </tr>
    <%for(article in articlePage.list) {%>
    <tr>
      <td>${articleLP.index}</td>
      <td>${article.title}</td>
      <td>${@catalogCache.getNameByValue(article.cid)}</td>
      <td>${article.create_time, dateFormat="yyyy-MM-dd"}</td>
      <td>${article.author!""}</td>
      <td>
        <a class="link-update" href="/admin/article/view?id=${article.id }">查看</a>&nbsp;
        <a class="link-update" href="/admin/article/edit?id=${article.id }">修改</a>&nbsp;
        <a class="link-del" href="/admin/article/delete?id=${article.id }" onclick="return confirm('删除后无法恢复,确定要删除吗')">删除</a>&nbsp;
      </td>
    </tr>
    <%}%>
  </table>
  <%include("../common/_paginate.html", {"currentPage": articlePage.pageNumber, "totalPage": articlePage.totalPage, "totalRow": articlePage.totalRow, "actionUrl": "/admin/article/", "urlParas": "${urlParas}"}){}%>
</div>
<%}%>